/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.trandio.util;

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author Administrador
 */
public class ConexionDb {

    public Connection traerConexion() throws NamingException, SQLException {
        Context init = new InitialContext();
        Context ctx = (Context) init.lookup("java:comp/env");
        DataSource ds = (DataSource) ctx.lookup("jdbc/salus");
        Connection con = ds.getConnection();
        return con;
    }
}
